package com.huitone.smspfm.context.thread;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**   
* @Title Main.java 
* @Package com.huitone.smspfm.context.thread 
* @Description TODO(用一句话描述该文件做什么) 
* @author ybliang   
* @date 2017年6月27日 下午3:41:21 
* @version V1.0   
*/
public class Main {

	public static void main(String[] args) {
		
		//ExecutorService es1 = Executors.newFixedThreadPool(10);
		ExecutorService es1 = AppCustomBlockingThreadPool.newBlockingThreadPool(10);
		
		for (int i = 0 ; i < 1000 ; i ++) {
			int out = i;
			es1.execute(new Runnable() {
				
				@Override
				public void run() {
					try {
						Thread.sleep(1000 * (out % 2));
						System.out.println("index:" + out);
					} catch (InterruptedException e) {
						e.printStackTrace();
					}
				}
			});
		}
	}

}
